// SPDX-License-Identifier: GPL-2.0+
#include <common.h>
#include <cpu_func.h>
#include <hang.h>
#include <init.h>
#include <log.h>
#include <spl.h>
#include <asm/global_data.h>
#include <asm/smp.h>
#include <asm/system.h>
#include <debug_uart.h>
#include <serial.h>
#include <version.h>

#if CONFIG_IS_ENABLED(BANNER_PRINT)
#include <timestamp.h>
#endif

DECLARE_GLOBAL_DATA_PTR;

void board_init_f(ulong dummy)
{
	int ret;

	ret = spl_early_init();
	if (ret)
		panic("spl_early_init() failed: %d\n", ret);

	gd->baudrate = CONFIG_BAUDRATE;
	serial_init();          /* serial communications setup */
	gd->have_console = 1;
	// debug_uart_init();

	// ret = uclass_get_device(UCLASS_RAM, 0, &dev);
	// if (ret) {
	//      panic("DRAM init failed: %d\n", ret);
	//      return;
	// }
#ifdef CONFIG_TPL_BANNER_PRINT
	printf("\nTPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \
                               U_BOOT_TIME ")\n");
#endif
}
